import {ReadExpire, WriteExpire} from "../Utils/Storage";

let token = '';
export const Token = ()=>token;
export function setAuthenticated(userToken)
{
    token = userToken;
    WriteExpire('userToken', userToken, 20);
    //console.log('g_isAuth:', isAuthenticated);
}
export function isAuthenticated()
{
    //console.log('sdfsdgfsg');
    //WriteExpire('isLogin', true, 10);
    const res = ReadExpire('userToken')
    if (res != null)
    {
        token = res;
    }
    else{
        token = '';
    }
    return res;
}